class Creator {
  constructor() {
    this.injectedPrompts = [];

    this.featurePrompt = {
      name: "features",
      message: "Check the features needed for your project",
      pageSize: 10,
      type: "checkbox",
      choices: [],
    };
  }

  getFinalPrompts() {
    this.injectedPrompts.forEach((prompt) => {
      const sourceWhen = prompt.when || (() => true);
      prompt.when = (answer) => sourceWhen(answer);
    });
    const prompts = [this.featurePrompt, ...this.injectedPrompts];

    return prompts;
  }
}

module.exports = Creator;
